import { DeviceType, SwitchInput } from '@babylonjs/core/DeviceInput/InputDevices/deviceEnums';
import { DeviceSource } from '@babylonjs/core/DeviceInput/InputDevices/deviceSource';
import { InputKeyStatus } from '../input-key-status';
import { DeviceInputKey } from '../device-information';


/**
 * @internal
 * 生成switch手柄预设
 * @param device 设备源
 * @returns switch手柄预设
 */
const SwitchPreset = (device: DeviceSource<DeviceType.Switch>) => {
    return {
        A: new InputKeyStatus(DeviceInputKey.switchA, SwitchInput.A, device),
        B: new InputKeyStatus(DeviceInputKey.switchB, SwitchInput.B, device),
        Capture: new InputKeyStatus(DeviceInputKey.switchCapture, SwitchInput.Capture, device),
        DPadDown: new InputKeyStatus(DeviceInputKey.switchDPadDown, SwitchInput.DPadDown, device),
        DPadLeft: new InputKeyStatus(DeviceInputKey.switchDPadLeft, SwitchInput.DPadLeft, device),
        DPadRight: new InputKeyStatus(DeviceInputKey.switchDPadRight, SwitchInput.DPadRight, device),
        DPadUp: new InputKeyStatus(DeviceInputKey.switchDPadUp, SwitchInput.DPadUp, device),
        Home: new InputKeyStatus(DeviceInputKey.switchHome, SwitchInput.Home, device),
        L: new InputKeyStatus(DeviceInputKey.switchL, SwitchInput.L, device),
        LS: new InputKeyStatus(DeviceInputKey.switchLS, SwitchInput.LS, device),
        LStickXAxis: new InputKeyStatus(DeviceInputKey.switchLStickXAxis, SwitchInput.LStickXAxis, device),
        LStickYAxis: new InputKeyStatus(DeviceInputKey.switchLStickYAxis, SwitchInput.LStickYAxis, device),
        Minus: new InputKeyStatus(DeviceInputKey.switchMinus, SwitchInput.Minus, device),
        Plus: new InputKeyStatus(DeviceInputKey.switchPlus, SwitchInput.Plus, device),
        R: new InputKeyStatus(DeviceInputKey.switchR, SwitchInput.R, device),
        RS: new InputKeyStatus(DeviceInputKey.switchRS, SwitchInput.RS, device),
        RStickXAxis: new InputKeyStatus(DeviceInputKey.switchRStickXAxis, SwitchInput.RStickXAxis, device),
        RStickYAxis: new InputKeyStatus(DeviceInputKey.switchRStickYAxis, SwitchInput.RStickYAxis, device),
        X: new InputKeyStatus(DeviceInputKey.switchX, SwitchInput.X, device),
        Y: new InputKeyStatus(DeviceInputKey.switchY, SwitchInput.Y, device),
        ZL: new InputKeyStatus(DeviceInputKey.switchZL, SwitchInput.ZL, device),
        ZR: new InputKeyStatus(DeviceInputKey.switchZR, SwitchInput.ZR, device),
    };
};


export { SwitchPreset };